package com.jwater.core.net;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import com.jwater.core.common.ScanPath;

import jwater.org.springframework.core.io.Resource;
import jwater.org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import jwater.org.springframework.core.io.support.ResourcePatternResolver;
/**
 * @description:
 * @author: jnner
 * @createDate: 2021/2/5
 * @version: 1.0
 */
public class ScanRpcServiceConfig {
	protected static List<Resource> getScanResource() throws IOException {
		List<Resource> resourceList = new ArrayList<Resource>();
		ResourcePatternResolver resolver = new PathMatchingResourcePatternResolver();
		for (String path : ScanPath.paths) {
			Resource resources[] = resolver.getResources(path);
			if (resources != null) {
				for (Resource resource : resources) {
					resourceList.add(resource);
				}
			}
		}
		return resourceList;
	}
}
